package com.peng._07springaop.aop;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @Author peng
 * @Date 2024-04-29 9:50
 */
public class CalculatorTest {
    public static void main(String[] args) {
        ApplicationContext context = new AnnotationConfigApplicationContext("com.peng._07springaop");
        Calculator calculator = context.getBean(Calculator.class);
        System.out.println("add(1,2) = " + calculator.add(1, 2));
        System.out.println("sub(1,2) = " + calculator.sub(2, 3));
        System.out.println("mul(1,2) = " + calculator.mul(3, 4));
        System.out.println("div(1,2) = " + calculator.div(10, 0));

    }
}
